{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\users\\administrator\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\pandas\\core\\indexing.py:140: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
      "  self._setitem_with_indexer(indexer, value)\n"
     ]
    }
   ],
   "source": [
    "p1 = pd.read_csv('../result/fuse/lgb_raw_0.612725448989865_02191837.csv')\n",
    "p2 = pd.read_csv('../result/fuse/lgbm_test_100.csv')\n",
    "p3 = pd.read_csv('../result/fuse/lgbm_test_101.csv')\n",
    "\n",
    "p1['Score'] = (p1['Score'] + p2['Score'] + p3['Score']) / 3\n",
    "\n",
    "def threshold(result):\n",
    "    boolean = (result['Score'] >= 4.0) & (result['Score'] < 4.732)\n",
    "    result['Score'].ix[boolean] = 4\n",
    "    result['Score'].ix[(result['Score'] >= 4.732)] = 5.0\n",
    "    return result\n",
    "\n",
    "result = threshold(p1)\n",
    "result.to_csv('../result/fuse/AVG_02191846.csv', index = False, header = False)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
